package org.lq.swket.ssm.service.impl;

import org.lq.swket.ssm.dto.DemoDTO;
import org.lq.swket.ssm.dto.util.Populate;
import org.lq.swket.ssm.mapper.DemoMapper;
import org.lq.swket.ssm.po.DemoPO;
import org.lq.swket.ssm.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DemoServiceImpl implements DemoService {

    @Autowired
    private DemoMapper demoMapper ;

    @Override
    public DemoDTO search(Integer id) throws Exception {
        DemoPO demoPO = demoMapper.selectById(id);
        DemoDTO demoDTO = new DemoDTO();
        Populate.demoPOToDemoDTO(demoPO,demoDTO);
        return demoDTO;
    }
}
